package com.moonLight.weblog.admin.convert;

import com.moonLight.weblog.admin.model.vo.article.PublishArticleReqVO;
import com.moonLight.weblog.common.domain.dos.TArticleContentRelDo;
import com.moonLight.weblog.common.domain.dos.TArticleDo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface PublishArticleReqSettingsConvert {

    PublishArticleReqSettingsConvert INSTANCE = Mappers.getMapper(PublishArticleReqSettingsConvert.class);



    /**
     * 将 VO 转化为 DO
     * @param bean
     * @return
     */
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "readNum", ignore = true)
    @Mapping(target = "isDeleted", ignore = true)
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    TArticleDo convertPublishArticleVO2TArticleDO(PublishArticleReqVO bean);
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "articleId", ignore = true)
    TArticleContentRelDo convertPublishArticleVO2TArticleContentDO(PublishArticleReqVO bean);

}
